<style>
    .tan-telphone{
        position: fixed;
        top: 34%;
        left: 7%;
        width: 90%;
        height: 39%;
        /*border-radius: 6px;*/
        background-image: url(__STATIC__/move/img/car_background.jpg);
        background-repeat: no-repeat;
        background-size: 100% 100%;
        /*background-color: #fff;*/
        z-index: 999;
    }
    .tan-telphone>span{
        position: absolute;
        top: 10px;
        right: 10px;
        width: 16px;
        height: 16px;
        line-height: 14px;
        text-align: center;
        border: 1px solid #fff;
        border-radius: 50%;
        font-size: 12px;
        color: #fff;
    }
    .tan-telphone .tan-input{
        position: absolute;
        bottom: 10px;
        right: 12px;
        width: calc(100% - 24px);
        height: 40px;
        margin-left: 12px;
        border-radius: 8px;
        overflow: hidden;
        background-color: #fff;
    }
    .tan-telphone .tan-input input{
        float: left;
        width: calc(100% - 64px);
        height: 40px;
        font-size: 12px;
    }
    .tan-telphone .tan-input span{
        float: right;
        display: inline-block;
        width: 64px;
        height: 40px;
        line-height: 40px;
        text-align: center;
        color: #7f4206;
        background-color: #ecc6a1;
    }
    .righttel2{
        width: 20px;
        position: fixed;
        top: 50%;
        bottom: 45%;
        left: 0;
        background: #1697f1;
        color: whitesmoke;
        margin-top: -50px;
        margin-bottom: -50px;
        font-size: 1em;
        text-align: center;
        border-radius: 0 5px 5px 0;
        display: block;
        z-index: 555;
    }
</style>
<div id="righttel" class="righttel2" style="">
    <span class="openwin">免费电话咨询</span>
</div>

<div class="tan-telphone" style="display: none">
    <span>X</span>
    <div class="clearfix tan-input" style="margin-bottom: 22px;
    margin-right: 36px;
    width: 80%;
    color: #000;">
        <input type="number" class="numberclick" placeholder="请输手机号，报价将以短信发送！" />
        <span id="moveclick">获取报价</span>
    </div>
</div>
<script type="text/javascript">
    var time = 30;
    $(function () {
        downTime()
    })

    $(".tan-telphone span").click(function(){
        $('.righttel2').show();
       $(".tan-telphone").hide()
        time = 30;
        downTime()
    })
    $('.openwin').click(function (){
        $('.tan-telphone').show();
        $('.righttel2').hide();
    })
    function downTime(){
        console.log(time)
        clearInterval(downTime)
        var downTime = setInterval(function(){
            time--;
            console.log(time)
            if(time<0){
                console.log(time)
                clearInterval(downTime)
                $(".tan-telphone").show()

            }
        },1000)

    }

    $('#moveclick').click(function(){
        var tel = $('.numberclick').val();
        if(!(/^1[3456789]\d{9}$/.test(tel))){
            alert("手机号码有误，请重填");
            return false;
        }
        $.post('formsubmit',{tel:tel},function(res){
            if(res == 1) {
                alert('提交成功 短信稍后发送给您');
            }else{
               alert('提交失败 请稍后重试');
            }
        });
    });

</script>
<style>
.appoint-car-tan {
display:none;
position: fixed;
top: 20%;
left: 10%;
width: calc(90% - 40px);
text-align: center;
background-image:url(/static/move/img/bgm.png);
background-repeat: no-repeat;
background-size: 100%;
    z-index:999;
}

.appoint-car-tan .close-appoint {
height: 36px;
line-height: 32px;
text-align: right;
font-size: 26px;
color: #FFFFFF;

}

.appoint-car-tan .appoint-tan-content {
padding-bottom: 20px;
background-color: #ededed;
}

.appoint-car-tan .appoint-tan-content > h2 {
height: 50px;
line-height: 50px;
color: #007AFF;
}

.appoint-car-tan .appoint-tan-content .appoint-tan-all .appoint-tan-list {
margin-bottom: 10px;
text-align: left;
}

.appoint-car-tan .appoint-tan-content .appoint-tan-all .appoint-tan-left {
width: 36px;
line-height: 30px;
}

.appoint-car-tan .appoint-tan-content .appoint-tan-all input {
width: calc(100% - 42px);
height: 30px;
margin-left: 6px;
padding-left: 8px;
}

.appoint-car-tan .appoint-tan-content .appoint-tan-all .appoint-likecar .fl {
width: 50%;
line-height: 34px;
padding-left: 8px;
}

.appoint-car-tan .appoint-tan-content .appoint-tan-all .appoint-likecar .fl input {
float: left;
width: 10px;
margin-top: 2px;
}

.appoint-car-tan .appoint-tan-content .appoint-tan-all .nowSend {
width: 100px;
height: 36px;
line-height: 36px;
margin: 0 auto;
background-color: #1880d8;
color: #FFFFFF;
}
</style>


<!-- 预约试驾弹框 -->
<div class="appoint-car-tan" >
    <div class="close-appoint padd12">—</div>
    <div class="appoint-tan-content padd12">
        <h2>预约试驾</h2>
        <div class="appoint-tan-all">
            <form action="{:url('move/appoint/create')}" method="post">

                <div class="appoint-tan-list clearfix">
                    <div class="fl appoint-tan-left">姓名:</div>
                    <input class="fl" type="text" placeholder="例如:王先生" name="name" autocomplete="off" required/>
                </div>
                <div class="appoint-tan-list clearfix">
                    <div class="fl appoint-tan-left">电话:</div>
                    <input class="fl" type="text" placeholder="已加密" name="phone" autocomplete="off" required/>
                </div>
                <div class="appoint-tan-list">
                    <div class="">意向车型（可多选)</div>
                    <div class="clearfix appoint-likecar">
                        {volist name="cate" id="item"}
                        <div class="fl">
                            <input type="checkbox" name="cid[]" class="checkbox" value="{$item.id}" {}/>{$item.name}
                        </div>
                        {/volist}

                    </div>
                </div>
                <div class="appoint-tan-list">
                    <div class="">购车周期</div>
                    <div class="clearfix appoint-likecar">
                        {volist name="plan_time" id="item"}
                        <div class="fl">
                            <input type="radio" class="radio" name="play_time" value="{$item.value}"/>{$item.label}
                        </div>
                        {/volist}

                    </div>
                </div>
                <div><input class="nowSend" type="submit" value="立即发送"></div>
            </form>
        </div>
    </div>
</div>
<script>
    $('#yysj').click(function(){
        $('.appoint-car-tan').show();
    })
    $('.close-appoint').click(function(){
        $('.appoint-car-tan').hide();
    });
</script>